scripting subtlties [closed]

Posted by jpmyob on Stack Overflow See other posts from Stack Overflow or by jpmyob
Published on 2011-06-23T13:38:56Z Indexed on 2011/06/23 16:22 UTC
Read the original article Hit count: 201

Filed under:

Possible Duplicates:
When to use anonymous JavaScript functions?
Is there any difference between var name = function() {} & function name() {} in Javascript?

in javascript (and other scripting languages) what is the 'real' difference between these two syntax:

a) function myFun(x) { yadda yadda }

b) myFun(x) = function { yadda yadda }

to a casual observer - no 'real' difference - you still call either as myFun()...and they still return the same thing, so if reference and return are identical - is it a preference or is there some difference in the code parsing engine that treats these two differently - and if so - when would you use one over the other???

© Stack Overflow or respective owner

Related posts about JavaScript